package com.briup.app01.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.briup.app01.bean.SalPlan;
import com.briup.app01.bean.SalPlanExample;
import com.briup.app01.bean.SalPlanExample.Criteria;
import com.briup.app01.dao.SalPlanMapper;
import com.briup.app01.service.SalPlanService;
@Service
public class SalPlanServiceImpl implements SalPlanService {
	@Autowired
	private SalPlanMapper planMapper;
	public void saveOrUpdate(SalPlan plan) {
		if(plan.getPlaChcId()==null) {
			planMapper.insertSelective(plan);
		}else {
			planMapper.updateByPrimaryKey(plan);
	     }
	}
	public void deleteById(long id) {
		planMapper.deleteByPrimaryKey(id);
	}
	public SalPlan selectById(long id) {
		return planMapper.selectByPrimaryKey(id);
	}
	
	public List<SalPlan> select(long chc_id, String todo,String result) {
		SalPlanExample example = new SalPlanExample();
/*    	Criteria criteria = example.createCriteria();
    	if(type!=null) {
    		criteria.andSvrTypeLike("%"+type+"%");
    	}
    	if(title!=null) {
    		criteria.andSvrTitleLike("%"+title+"%");
    }
    	if(status!=null) {
    		criteria.andSvrStatusLike("%"+status+"%");
    	}*/
    		return planMapper.selectByExample(example);
	}
	
	}
	
	
	
	
	